home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-21 | 425 b | 20 lines | [TEXT/ttxt] |
- //---------------------------------------------------------------------------
- // dot.r
-
- // Syntax: dot ( A , B )
-
- // Description:
-
- // Compute the dot product of two vectors, A and B.
- //---------------------------------------------------------------------------
-
- dot = function ( A , B )
- {
- if (min (size (A) != 1) || min (size (B) != 1)) {
- error ("dot: A and B must be vectos");
- }
- return sum (A[:] .* B[:])
- };
-
-
-